PR: Second round: clean imports and qualifiers#584
PR: Second round: clean imports and qualifiers#584lieryan merged 17 commits intopython-rope:masterfrom edreamleo:ekr-clean2
Conversation
|
@lieryan I plan no more commits to this branch. |
rope/refactor/functionutils.py
Outdated
| @@ -1,7 +1,6 @@ | |||
| import rope.base.exceptions | |||
| import rope.base.pyobjects | |||
| # import rope.base.exceptions | |||
There was a problem hiding this comment.
Unused import?
| # import rope.base.exceptions |
There was a problem hiding this comment.
Oops. I'll remove that comment.
|
@edreamleo thanks for doing this. Maybe rather than adding comments about the full import qualification, we should just document this centrally? I'd recommend a new section in |
|
@lieryan But who reads "central" documentation? I like to document the code in place if it's not too odious. |
|
@lieryan I see you have already updated master, so I'll use your suggested code. |
|
@lieryan I'm good with this PR now. We could quibble about exactly when to use full qualification, but who would want to do that :-) |
|
Import style consistency is nice, but I'm personally not too fussed if sometimes we forget about it and a couple non compliant imports slipped in 🤷♂️. If necessary, in the future, we can write a pre-commit/GHA script to enforce the import style. So that it'll always be consistent without needing the comments. It seems like it can be a useful capability for Though I think I'm getting too much into ideas mode here, let's pull back before I get in too deep into this. |
Agreed, the comments are fine as is for now, it's not a blocker for this PR. |
This PR continues PR #583. This PR suggests a consistent style for imports, thereby regularizing (minimizing) qualified names. All changes should be straightforward and uncontroversial.
This PR adds or maintains (with new comments) fully qualified names for
builtins,change,fscommands, andwildcardswhen those names would clash with other names.This PR removes qualifications for modules (like pyobjects and several others) whose names conflict neither with the names other modules (in stdlib or Rope) nor other vars.
Note: The qualification of
astremains completely unchanged. Some files userope.base.ast; other files accessrope.base.astwith an unqualifiedast.